Skip to content

[python-jose] Annotate cryptography backend key methods - #17037

Open
arod19 wants to merge 1 commit into
python:mainfrom
arod19:jose-cryptography-key-types
Open

arod19 wants to merge 1 commit into
python:mainfrom
arod19:jose-cryptography-key-types

Conversation

@arod19

@arod19 arod19 commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Annotate the key methods of the cryptography backend classes, which had no types, to match the signatures already declared on the base Key class (plus is_public() -> bool).

Upstream (3.5.0): https://github.com/mpdavis/python-jose/blob/3.5.0/jose/backends/cryptography_backend.py, e.g. verify returns True/False (#L142-L148), public_key returns self or a new instance of the same class (#L153-L156), is_public is a hasattr check (#L150-L151).

Written with Claude Code; I reviewed the diff against the upstream source.

Match the signatures already declared on the base Key class, plus
is_public() -> bool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RCp18C76bvFh9tnMTumo53
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant